<template>
  <div>

  </div>
</template>

<script>
export default {
  data () {
    return {
      data: []
    }
  },
  components: {

  },
  methods: {

  },
  created () {
    // get请求
    this.$axios.get('https://www.baidu.com', {
      params: {
        ID: 12345
      },
      headers: {

      }
    }).then((result) => {
      console.log(result);
      this.data = result.data.messages;
    }).catch((err) => {
      console.error(err)
    });
    // post请求
    this.$axios.post('https://www.baidu.com', { password: '2345' }).then((result) => {
      console.log(result);
    }).catch((err) => {
      console.error(err);
    });
  },
  mounted () {

  }
}
</script>

<style scoped>
</style>
